package com.study.zouchao.superproject.login.view.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.study.zouchao.superproject.R;
import com.study.zouchao.superproject.base_zou.MyBaseActivity;


/**
 * Created by Administrator on 2017/1/19.
 */

public class LoginActivity extends MyBaseActivity {

    private static final String TAG = "LoginA";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
    }


    public static void actionLoginActivity(Context context, String key, String value) {
        Intent intent = new Intent(context, LoginActivity.class);
        intent.putExtra(key, value);
        context.startActivity(intent);
    }


    public static void actionLoginActivityByTop(Context context, String key, String value) {
        Intent intent = new Intent(context, LoginActivity.class);
        intent.putExtra(key, value);
        //与singleTop类似 若目标已经是栈顶则不new 否则new
        intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
        //添加了此标记 并且 目标activity已经存在 则会将目标activity上的activity全部销毁 然后将目标activity置于栈顶(显示出来)
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        context.startActivity(intent);
    }
}
